package com.aiti.lulian.mapper.gxmh;

import com.aiti.lulian.gxmh.dto.GxmhUserRegisterDto;
import com.aiti.lulian.gxmh.dto.SubUser;
import com.aiti.lulian.gxmh.dto.SysUserDto;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface GxmhSysMapper {

    SysUserDto queryUserInfo(@Param("userId") String userId);

    /**
     * 查询用户是否已经存在
     * @param username
     * @return
     */
    Integer queryUserRegisterCount(@Param("username") String username);

    String queryUserIdByUsername(@Param("username") String username);

    String queryEnterpriseIdByUserId(@Param("userId") String userId);

    void insertUserRegisterInfo(@Param("dto")GxmhUserRegisterDto dto);

    void updateUserInfo(@Param("dto")GxmhUserRegisterDto dto, @Param("userId") String userId);

    String queryUserExtentInfoBaseId(@Param("userId") String userId);

    void insertUserRole(@Param("baseId")String baseId, @Param("userId")String userId, @Param("roleId")String roleId);

    String queryBindedUserIdByEnterpriseId(@Param("enterpriseId") String enterpriseId);

    void insertUserExtentInfo(@Param("baseId") String uuid, @Param("userId") String userId, @Param("gxmhEnterpriseName") String gxmhEnterpriseName);

    List<String> queryUserRoleList(@Param("userId") String userId);

    void insertServerUser(@Param("dto")SubUser dto);

    void deleteUserByUsername(@Param("username") String username);

    void deleteUserByUserId(@Param("userId") String userId);

    void deleteUserRoleByUserId(@Param("userId") String userId);

    String queryEnterpriseAdminUserId(@Param("enterpriseId") String enterpriseId);

    List<String> queryUserIdListByMobileList(@Param("mobileList") List<String> mobileList);

    // 判断企业下用户有没有个人角色
    Integer queryUserRoleCount(@Param("enterpriseId") String enterpriseId, @Param("userId") String userId, @Param("roleId") String roleId);

    void insertUserRoleEnterrpise(@Param("baseId")String baseId, @Param("userId")String userId, @Param("roleId")String roleId, @Param("enterpriseId")String enterpriseId);

    void deleteUserRoleEnterprise(@Param("userId") String userId, @Param("enterpriseId") String enterpriseId);
}
